//
//  WZTableViewController.swift
//  weibo
//
//  Created by mac on 16/2/24.
//  Copyright © 2016年 mac. All rights reserved.
//

import UIKit

class WZTableViewController: UITableViewController,VisitorDelegate  {

    var visitor: WZVisitor?
    
//     var isLogin: Bool = false
 
    
    override func loadView() {
        
        
        print(WZUserViewModel.shareInstance.isLogin)
        if WZUserViewModel.shareInstance.isLogin {
            
            super.loadView()
        }else{
            
            visitor = WZVisitor()
            visitor?.delegate = self
            view = visitor

            
        }
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        setNavBarItem()
    }
 

    func setNavBarItem(){
        
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Plain, target: self, action: "registClick");
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "登录", style: UIBarButtonItemStyle.Plain, target: self, action: "loginClick");
    }
    
    
    
    func loginClick(){
        

        
    }
    func registClick(){
        
        
    }
    
//    MARK: -- 实现visitor中"登录""注册"的代理事件
    func loginBtnClick() {
                presentViewController(UINavigationController(rootViewController: WZAuthViewController()), animated: true) { () -> Void in
        
                }
    }

    func registBtnClick() {
        
    }
}


